﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using smx.Properties;
using PSTaskDialog;

namespace smx
{
    public partial class ChangeSettings : Form
    {
        public ChangeSettings()
        {
            InitializeComponent();
        }

        private void ChangeSettings_Load(object sender, EventArgs e)
        {
            financeTxt.Text = Settings.Default.finance.ToString();

            musicCheck.Checked = Settings.Default.startupnoise;
        }

        private void saveBtn_Click(object sender, EventArgs e)
        {
            try
            {
                Settings.Default.finance = Convert.ToDecimal(financeTxt.Text);
                Settings.Default.startupnoise = musicCheck.Checked;
                Settings.Default.Save();
                cTaskDialog.MessageBox(this,
"Settings Change",
"The settings are changed",
"The settings you have chosen are now changed",
eTaskDialogButtons.OK,
eSysIcons.Information);
            }
            catch (Exception err)
            {
                cTaskDialog.MessageBox(this, "Error in Code",
               "There was an error!",
               "There was an error in changing the settings, please check all the values and contact us if this problem persists. For more information read the details " + err.Message,
               err.ToString(), "Settings error", "", eTaskDialogButtons.OK, eSysIcons.Error, eSysIcons.Error);
            }
        }
    }
}
